<h1>My perfect opposites</h1>

<?php $perfectOpposites = $user->getPerfectOpposites(5) ?>
<?php if (count($perfectOpposites) == 0): ?>
<p>You have not selected anyone as a perfect opposite</p>
<?php else: ?>
<?php foreach($perfectOpposites as $opposite):?>
<?php /* @var $opposite Opposite */ ?>

<div class="group opposite-reaction">
	<div class="avatar">
		<?php
			$className = $opposite->getShowProfile() == 1 ? 'class=profile profile-'.$opposite->getId() : '';
			echo image_tag($opposite->getThumbnailUrl(), 'alt='.$opposite->getName().' '.$className);
		?>
	</div>

	<div class="perfect">
		<h4 class="group">
			<span>
				<strong><?php echo $opposite->getName()?></strong>
				<?php if($opposite->getCountry() || $opposite->getOrigin()):?>
					(<?php if($opposite->getCountry()) echo $opposite->getCountry()?>
					<?php if($opposite->getCountry() && $opposite->getOrigin()):?> - <?php endif;?>
					<?php if($opposite->getOrigin()): ?><em><?php echo $opposite->getOrigin()?></em><?php endif; ?>)
				<?php endif; ?>
			</span>

			<?php
				$percentage = $opposite->getOppositePercentage();
				$className  = Round(Round($percentage)/10) * 10;
			?>		
			<span class="oppositeness-<?php echo $className?>"><?php echo Round($percentage) ?>%</span>
			<span class="respects"><?php echo $opposite->getNumRespects()?></span>
		</h4>
		<?php if($opposite->getCachedStatementText()):?>
		<p><?php echo $opposite->getCachedReactionText()?></p>
		<p class="meta">Latest comment to the statement: <span class="debate debate-<?php echo $opposite->getCachedStatementId()?>">&quot;<?php echo $opposite->getCachedStatementText()?>&quot;</span></p>
		<?php else:?>
		<p>This user has not made any comments yet.</p>
		<p class="meta">&nbsp;</p>
		<?php endif; ?>
	</div>
</div>
<?php endforeach?>
<?php endif; ?>

<h1>My opposites</h1>
<?php $myOpposites = $user->getOpposites(10); ?>
<?php if (count($myOpposites) == 0): ?>
<p>There are no opposites for you yet.</p>
<?php else: ?>
<?php foreach($user->getOpposites(10) as $opposite):?>
<div class="group opposite-reaction">
	<div class="avatar">
		<?php
			$className = $opposite->getShowProfile() == 1 ? 'class=profile profile-'.$opposite->getId() : '';
			echo image_tag($opposite->getThumbnailUrl(), 'alt='.$opposite->getName().' '.$className);
		?>
	</div>

	<div>
		<h4 class="group">
			<span>
				<strong><?php echo $opposite->getName()?></strong>
				<?php if($opposite->getCountry() || $opposite->getOrigin()):?>
					(<?php if($opposite->getCountry()) echo $opposite->getCountry()?>
					<?php if($opposite->getCountry() && $opposite->getOrigin()):?> - <?php endif;?>
					<?php if($opposite->getOrigin()): ?><em><?php echo $opposite->getOrigin()?></em><?php endif; ?>)
				<?php endif; ?>
			</span>
			<?php
				$percentage = $opposite->getOppositePercentage();
				$className  = Round(Round($percentage)/10) * 10;
			?>		
			<span class="oppositeness-<?php echo $className?>"><?php echo Round($percentage) ?>%</span>
			<span class="respects"><?php echo $opposite->getNumRespects()?></span>
		</h4>
		<?php if($opposite->getCachedStatementText()):?>
		<p><?php echo $opposite->getCachedReactionText()?></p>
		<p class="meta">Latest comment to the statement: <span class="debate debate-<?php echo $opposite->getCachedStatementId()?>">&quot;<?php echo $opposite->getCachedStatementText()?>&quot;</span></p>
		<?php else:?>
		<p>This user has not made any comments yet.</p>
		<p class="meta">&nbsp;</p>
		<?php endif; ?>
	</div>
</div>
<?php endforeach?>
<p class="group">
	<span class="more-opposites">More opposites...</span>
</p>
<?php endif; ?>